package com.ultimatech.feign.service;

import com.ultimatech.cloud.poc.base.model.Message;
import com.ultimatech.cloud.poc.base.model.TestData;
import com.ultimatech.cloud.poc.base.model.UserVo;
import com.ultimatech.feign.service.impl.SchedualServiceHiImpl;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhangleping on 2017/9/27.
 */
@FeignClient(value = "service-hi", fallback = SchedualServiceHiImpl.class)
public interface ISchedualServiceHi {

    @RequestMapping(value = "/hi", method = RequestMethod.GET)
    String sayHiFromClientOne(@RequestParam(value = "name") String name);

    @RequestMapping(value = "/whoami",method = RequestMethod.GET)
    String whoami(@RequestParam(value = "name") String name);

    @RequestMapping(value = "/test",method = RequestMethod.GET)
    TestData test(@RequestParam(value = "name") String name);

    @RequestMapping(path = "/createUser",method = RequestMethod.POST)
    Message<UserVo> createUser(@RequestBody UserVo user);

    @RequestMapping(path = "/delUser",method = RequestMethod.GET)
    Message<Integer> delUser(@RequestParam(value = "userId") Integer userId);

    @RequestMapping(path = "/updateUser",method = RequestMethod.POST)
    Message<UserVo> updateUser(@RequestBody UserVo user);

    @RequestMapping(path = "/getuser",method = RequestMethod.GET)
    Message<UserVo> getUserById(@RequestParam(value = "id") Integer id);

    @RequestMapping(path = "/findAllUser",method = RequestMethod.GET)
    Message<List<UserVo>> findAllUser();

}

